
import XHeader from 'vux/src/components/x-header/index.vue'
import Tab from 'vux/src/components/tab/tab.vue'
import TabItem from 'vux/src/components/tab/tab-item.vue'
import Swiper from 'vux/src/components/swiper/swiper.vue'
import SwiperItem from 'vux/src/components/swiper/swiper-item.vue'
import XButton from 'vux/src/components/x-button/index.vue'
import Flexbox from 'vux/src/components/flexbox/flexbox.vue'
import FlexboxItem from 'vux/src/components/flexbox/flexbox-item.vue'
import XProgress from 'vux/src/components/x-progress/index.vue'
import Popup from 'vux/src/components/popup/index.vue'
import Group from 'vux/src/components/group/index.vue'
import Cell from 'vux/src/components/cell/index.vue'
import Checker from 'vux/src/components/checker/checker.vue'
import Divider from 'vux/src/components/divider/index'
import CheckerItem from 'vux/src/components/checker/checker-item.vue'
import XInput from 'vux/src/components/x-input/index.vue'
import XTextarea from 'vux/src/components/x-textarea/index.vue'
import TransferDom from 'vux/src/directives/transfer-dom/index'
import Alert from 'vux/src/components/alert/index.vue'
import VueQr from 'vue-qr'

import Checklist from 'vux/src/components/checklist/index.vue'
import wx from 'weixin-js-sdk'

import CONSTANT from '@/common/constants.js';
import http from '@/common/http.js';


export default {
  name: 'togetherWelfare',
  directives: {
    TransferDom
  },
  components: {
    XButton,
    Flexbox,
    FlexboxItem,
    Checker,
    TransferDom,
    CheckerItem,
    Divider,
    Group,
    Cell,
    Popup,
    XInput,
    XTextarea,
    Checklist,
    Alert,
    VueQr,
  },
  data() {
    return {
      event_id: '',
      powmdnArr: [],
      toliste: [],

      index: 0,
      // 信息反馈是否有红点  为''的时候没有  为' '的时候有
      isXinxi: ' ',
      percent1: 60,
      show: false,
      demo: 1,
      isM: '募捐中',
      userId: '',
      eventType: '',
      feedBack: [],

      name: '',
      mobile: '',
      IDNum: '',
      liuyan: '',
      ifShowtt: false,
      address: '',
      titleAlert:'长按二维码保存',
      logoSrc:'',
      logoSrc: this.imageUrl.imageUrl+'/userfiles/2/images/1513911875.png',
      dotScale: 1,
      logoMargin: 5,
      margin: 0,
      logoCornerRadius: 4,
      item: 'item',
      textMoney: '',
      checkOK: true,
      isA: true,
      threshold: 50,
      minmovingdistance: 30,
      // 项目id
      event_id: '',
      // 显示哪一个模块
      witchShow: 'xiangqing',
      pageNoOther: 1,
      pageNoJuankuan: 1,
      pageSize: 20,
      eventAll: {},
      eventOther: [],
      eventJuankuan: [],
      lookMore: '查看更多',
      lookMoreJuankuans: '查看更多',
      leaveMessage: [],
      pageNoLeave: 1,
      isVolunteer: false,
      ifselected: false,
      configSuccess: false,
      qrcodeImg: '',
      showAlert: false,


      demo1: '',
      demo1Required: '2222',
      demo11: null,
      demo12: {key: '2', value: 'B'},
      demo21: null,
      demo22: [{key: '2', value: 'B'}],
      demo23: null,
      demo1Checkbox: [2, 1],
      demo1CheckboxMax: ['2', '3'],


      store: [{
        storeId : "111211",
        storeName: "测试",
        money: "0.00"
      },{
        storeId : "111211",
        storeName: "测试",
        money: "0.00"
      },{
        storeId : "111211",
        storeName: "测试",
        money: "0.00"
      },{
        storeId : "111211",
        storeName: "测试",
        money: "0.00"
      },{
        storeId : "111211",
        storeName: "测试",
        money: "0.00"
      },{
        storeId : "111211",
        storeName: "测试",
        money: "0.00"
      },],

    }
  },
  mounted() {
    this.event_id = window.sessionStorage.getItem('event_id')
    http.post(CONSTANT.EVENT_VIEW_TH, {event_id: this.event_id}, (res) => {
      console.log(res)
      for (var i = 0; i < res.obj.length; i++) {
      }
      this.toliste = res.obj
    })


  },
  methods: {

    onItemClick (value, disabled) {
      console.log(value, disabled)
      if (!this.disabled) {
        this.showPopup = false
      }
    },

    comeback() {
      // 返回上一页
      window.history.go(-1)
    },
    wantJuank () {
      // 我要捐款
      this.show = true
    },
    isShow () {
      // 弹出框关闭按钮
      this.show = false
    },
    keyups () {
      this.demo = this.textMoney
      this.ifselected = true
    },
    blurs () {
      this.ifselected = false
    },
    checkerWitch () {
      // 选择捐款金额
      // console.log(this.demo)
    },
    checkOk () {
      // 是否同意用户协议
      // console.log(this.checkOK)
    },
    textMoneyChange () {
      // console.log('hh')
    },
    goreport () {
      this.$router.push({path: '/report'})
    },
    godonation () {
      this.$router.push({path: '/donation'})
    },
    govolunteer () {
      this.$router.push({
        path: '/volunteer',
        query: {volunteerLocal: this.eventAll.volunteerLocal, volunteerTime: this.eventAll.volunteerTime}
      })
    },

  }
}
